Ext.define('Ext.overrides.grid.filters.filter.Date',{
  override: 'Ext.grid.filters.filter.Date',

  config: {
      /**
       * @cfg {Object} [fields]
       * Configures field items individually. These properties override those defined
       * by `{@link #itemDefaults}`.
       *
       * Example usage:
       *      fields: {
       *          gt: { // override fieldCfg options
       *              width: 200
       *          }
       *      },
       */
	  menuItems:['ge','le'
	  //,'eq'
	  ],
	  //menuItems:['gt','lt'],
	  fields: {
	      ge: {text: '从'},
	      le: {text: '到'}//,
	      //eq: {text: '那天'}
	  },

      /**
       * @cfg {Object} pickerDefaults
       * Configuration options for the date picker associated with each field.
       */
      pickerDefaults: {
          xtype: 'datepicker',
          border: 0
      },

      updateBuffer: 0,

      /**
      * @cfg {String} dateFormat
      * The date format to return when using getValue.
      * Defaults to {@link Ext.Date.defaultFormat}.
      */
      dateFormat: 'time'
  },
    onMenuSelect: function (picker, date) {
        var fields = this.fields,
            field = fields[picker.itemId],
            ge = fields.ge,
            le = fields.le,
            eq = fields.eq,
            v = {};

        field.up('menuitem').setChecked(true, /*suppressEvents*/ true);

        if (field === eq) {
            le.up('menuitem').setChecked(false, true);
            ge.up('menuitem').setChecked(false, true);
        } else {
        	//c4w
        	if(eq){
            	eq.up('menuitem').setChecked(false, true);
        	}
            if (field === ge && (+le.value < +date)) {
                le.up('menuitem').setChecked(false, true);
            } else if (field === le && (+ge.value > +date)) {
                ge.up('menuitem').setChecked(false, true);
            }
        }
        v[field.filterKey] = date;
        this.setValue(v);

        picker.up('menu').hide();
      }  
});